<?php


namespace King\Entity\Poker;


use King\Entity\User\User;

class Room
{
    public $name;
    public $id;
    public $totalNumber = 3;
    public $onlineNumber;

    public $userList = [];

    public function addUser(User $user)
    {
        if ($this->onlineNumber >= $this->totalNumber) {
            throwException(new \Exception('Exceed the maximum'));
        }
        $this->onlineNumber += 1;
        $user->seat = $this->onlineNumber;
        array_push($this->userList, $user);
    }
}